﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.EntityFrameworkCore;
using TianShiProject.Models.Common;
using TianShiProject.Models.Materials.Citys;
using Volo.Abp.EntityFrameworkCore;

namespace TianShiProject.Materials.Citys
{
    public class CountryRepository : DapperDbContextRepository, ICountryRepository
    {
        public CountryRepository(IDbContextProvider<TianShiProjectDbContext> dbContextProvider) : base(dbContextProvider)
        {
        }

        public async Task<PageResponse<CountryDto>> GetCountryShow(int id)
        {
            PageResponse<CountryDto> response = new PageResponse<CountryDto>();
            var sql = $"select * from Country where Province='{id}'";
            response.PageData = await this.QueryAsync<CountryDto>(sql);
            return response;

        }
    }
}
